package bg.btanev.eightyfour.shared.command.stat;

import java.util.Date;

import bg.btanev.eightyfour.shared.command.CommandInput;
import bg.btanev.eightyfour.shared.dto.TargetDto;

/**
 *
 * @author B.Tanev
 *
 */
public class StatCommandInput implements CommandInput {
	/**
	 *
	 */
	private static final long serialVersionUID = -5031099342103905413L;

	private TargetDto targetDto;
	private Date beginDate;
	private Date endDate;

	public StatCommandInput() {
		super();
	}

	public TargetDto getTargetDto() {
		return targetDto;
	}

	public void setTargetDto(TargetDto targetDto) {
		this.targetDto = targetDto;
	}

	public Date getBeginDate() {
		return beginDate;
	}

	public void setBeginDate(Date beginDate) {
		this.beginDate = beginDate;
	}

	public Date getEndDate() {
		return endDate;
	}

	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((beginDate == null) ? 0 : beginDate.hashCode());
		result = prime * result + ((endDate == null) ? 0 : endDate.hashCode());
		result = prime * result + ((targetDto == null) ? 0 : targetDto.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		StatCommandInput other = (StatCommandInput) obj;
		if (beginDate == null) {
			if (other.beginDate != null)
				return false;
		} else if (!beginDate.equals(other.beginDate))
			return false;
		if (endDate == null) {
			if (other.endDate != null)
				return false;
		} else if (!endDate.equals(other.endDate))
			return false;
		if (targetDto == null) {
			if (other.targetDto != null)
				return false;
		} else if (!targetDto.equals(other.targetDto))
			return false;
		return true;
	}

	@Override
	public String toString() {
		return "StatCommandInput [beginDate=" + beginDate + ", endDate=" + endDate + ", targetDto=" + targetDto + "]";
	}
}
